package com.ht.shop.utils;

import java.util.HashMap;
import java.util.Map;


public class RequestMappingUtils {
    private static Map<String, Object> targetObjectMap = new HashMap<>();

    private static Map<String, String> url2MethodMap = new HashMap<>();


    public static String getMethod(String key) {
        return url2MethodMap.get(key);
    }

    public static String addMethod(String url,String methodName) {
        return url2MethodMap.put(url, methodName);
    }


    public static Object getTarget(String uri) {
        return targetObjectMap.get(uri);
    }



    public static Object addTarget(String uri,Object target) {
        return targetObjectMap.put(uri, target);
    }
}

//    private static Properties properties = new Properties();
//    private static Map<String,Object> targetObjectMap = new HashMap<>();
//    static {
//        InputStream inputStream = DBUtils.class.getResourceAsStream("/requestmapping.properties");
//        try {
//            properties.load(inputStream);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//    public static String getMethod(String key) {return properties.getProperty(key);}
//
//    public static Object getTarget(String uri) {return targetObjectMap.get(uri);}
//
//    public static Object addTarget(String uri,Object target) {return targetObjectMap.put(uri,target);}
//}
